//index.js
//获取应用实例
const app = getApp()

Page({
  data: {
    StatusBar: app.globalData.StatusBar,
    CustomBar: app.globalData.CustomBar,
    Custom: app.globalData.Custom,
    hasUserInfo: false,
    TabCur: 1,
    scrollLeft: 0,
    userInfo:{}
  },
  getUserProfile:function(){
    
    wx.getUserProfile({
      desc: '获取用户信息',
      success:(res) => {
        console.log(res.userInfo);
        this.setData({
          hasUserInfo:true,
          userInfo:res.userInfo
        })
      }
    })
  }
,

gomsg:function(){
  wx.navigateTo({
    url:  "/pages/msg/msg",
  })
},
govip:function(){
  wx.navigateTo({
    url:  "/pages/vip/vip",
  })
},
golink:function(){
  wx.navigateTo({
    url:  "/pages/link/link",
  })
},
goabout:function(){
  wx.navigateTo({
    url:  "/pages/about/about",
  })
},
goget:function(){
  wx.navigateTo({
    url:  "/pages/get/get",
  })
},
  onShow() {
    this.tabBar();
      },
  tabBar() {
    if (typeof this.getTabBar === 'function' && this.getTabBar()) {
      this.getTabBar().setData({
        selected: 4
      })
    }
},

  showModal(e) {
    this.setData({
      modalName: e.currentTarget.dataset.target
    })
  },
  hideModal(e) {
    this.setData({
      modalName: null
    })
  },
  tabSelect(e) {
    console.log(e);
    this.setData({
      TabCur: e.currentTarget.dataset.id,
      scrollLeft: (e.currentTarget.dataset.id - 1) * 60
    })
  }
})
